//go:build !ignore_autogenerated
// +build !ignore_autogenerated

// SPDX-License-Identifier: Apache-2.0
// Copyright Authors of Cilium

// Code generated by deepequal-gen. DO NOT EDIT.

package types

// DeepEqual is an autogenerated deepequal function, deeply comparing the
// receiver with other. in must be non-nil.
func (in *RoutePolicy) DeepEqual(other *RoutePolicy) bool {
	if other == nil {
		return false
	}

	if in.Name != other.Name {
		return false
	}
	if in.Type != other.Type {
		return false
	}
	if ((in.Statements != nil) && (other.Statements != nil)) || ((in.Statements == nil) != (other.Statements == nil)) {
		in, other := &in.Statements, &other.Statements
		if other == nil {
			return false
		}

		if len(*in) != len(*other) {
			return false
		} else {
			for i, inElement := range *in {
				if !inElement.DeepEqual((*other)[i]) {
					return false
				}
			}
		}
	}

	return true
}

// DeepEqual is an autogenerated deepequal function, deeply comparing the
// receiver with other. in must be non-nil.
func (in *RoutePolicyActions) DeepEqual(other *RoutePolicyActions) bool {
	if other == nil {
		return false
	}

	if in.RouteAction != other.RouteAction {
		return false
	}
	if ((in.AddCommunities != nil) && (other.AddCommunities != nil)) || ((in.AddCommunities == nil) != (other.AddCommunities == nil)) {
		in, other := &in.AddCommunities, &other.AddCommunities
		if other == nil {
			return false
		}

		if len(*in) != len(*other) {
			return false
		} else {
			for i, inElement := range *in {
				if inElement != (*other)[i] {
					return false
				}
			}
		}
	}

	if ((in.AddLargeCommunities != nil) && (other.AddLargeCommunities != nil)) || ((in.AddLargeCommunities == nil) != (other.AddLargeCommunities == nil)) {
		in, other := &in.AddLargeCommunities, &other.AddLargeCommunities
		if other == nil {
			return false
		}

		if len(*in) != len(*other) {
			return false
		} else {
			for i, inElement := range *in {
				if inElement != (*other)[i] {
					return false
				}
			}
		}
	}

	if (in.SetLocalPreference == nil) != (other.SetLocalPreference == nil) {
		return false
	} else if in.SetLocalPreference != nil {
		if *in.SetLocalPreference != *other.SetLocalPreference {
			return false
		}
	}

	return true
}

// DeepEqual is an autogenerated deepequal function, deeply comparing the
// receiver with other. in must be non-nil.
func (in *RoutePolicyConditions) DeepEqual(other *RoutePolicyConditions) bool {
	if other == nil {
		return false
	}

	if ((in.MatchNeighbors != nil) && (other.MatchNeighbors != nil)) || ((in.MatchNeighbors == nil) != (other.MatchNeighbors == nil)) {
		in, other := &in.MatchNeighbors, &other.MatchNeighbors
		if other == nil {
			return false
		}

		if len(*in) != len(*other) {
			return false
		} else {
			for i, inElement := range *in {
				if inElement != (*other)[i] {
					return false
				}
			}
		}
	}

	if ((in.MatchPrefixes != nil) && (other.MatchPrefixes != nil)) || ((in.MatchPrefixes == nil) != (other.MatchPrefixes == nil)) {
		in, other := &in.MatchPrefixes, &other.MatchPrefixes
		if other == nil {
			return false
		}

		if len(*in) != len(*other) {
			return false
		} else {
			for i, inElement := range *in {
				if !inElement.DeepEqual((*other)[i]) {
					return false
				}
			}
		}
	}

	return true
}

// deepEqual is an autogenerated deepequal function, deeply comparing the
// receiver with other. in must be non-nil.
func (in *RoutePolicyPrefixMatch) deepEqual(other *RoutePolicyPrefixMatch) bool {
	if other == nil {
		return false
	}

	if in.PrefixLenMin != other.PrefixLenMin {
		return false
	}
	if in.PrefixLenMax != other.PrefixLenMax {
		return false
	}

	return true
}

// DeepEqual is an autogenerated deepequal function, deeply comparing the
// receiver with other. in must be non-nil.
func (in *RoutePolicyStatement) DeepEqual(other *RoutePolicyStatement) bool {
	if other == nil {
		return false
	}

	if !in.Conditions.DeepEqual(&other.Conditions) {
		return false
	}

	if !in.Actions.DeepEqual(&other.Actions) {
		return false
	}

	return true
}
